package com.lyr.thread;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        MyThread th1=new MyThread("李子");
        th1.start();

        System.out.println("如果想要中止线程，请输入 y ");
        Scanner sc=new Scanner(System.in);
        String strStopped=sc.nextLine();

        if (strStopped.trim().equalsIgnoreCase("y")){
            th1.setStopped(true);
        }
    }
}
